import axios from '@/libs/api.request'
/**
 * 角色成员列表-权限管理
 */
export const listAdminByRoleId = (data) => {
  return axios.request({
    url: 'sys/rbac/listAdminByRoleId',
    method: 'get',
    data: data
  })
}
/**
 * 分页查询-权限管理
 */
export const listForAdminRole = (data) => {
  return axios.request({
    url: 'sys/rbac/listForAdminRole',
    method: 'get',
    data: data
  })
}
/**
 * 保存权限管理
 */
export const saveAdminRole = (data) => {
  return axios.request({
    url: 'sys/rbac/saveAdminRole',
    method: 'post',
    data: data
  })
}
/**
 * 保存角色资源关系
 */
export const saveRoleResource = (data) => {
  return axios.request({
    url: 'sys/rbac/saveRoleResource',
    method: 'post',
    data: data
  })
}

/**
 * 删除权限管理--不可恢复
 */
export const deleteAdminRole = (data) => {
  return axios.request({
    url: 'sys/rbac/deleteAdminRole',
    method: 'post',
    data: data
  })
}
/**
 * 获取资源树
 */
export const getResourceTree = (data) => {
  return axios.request({
    url: 'sys/rbac/getResourceTree',
    method: 'get',
    data: data
  })
}
